package JavaDesign.report_11.t_2;

public class Application {
    public static void main(String args[]) throws NoSuchMethodException {
        MilitaryPerson LZ = new MilitaryOfficer("LZ", 5000);
        MilitaryPerson PZ1 = new MilitaryOfficer("一PZ", 4000);
        MilitaryPerson PZ2 = new MilitaryOfficer("二PZ", 4000);
        MilitaryPerson BZ11 = new MilitaryOfficer("一班长", 2000);
        MilitaryPerson BZ12 = new MilitaryOfficer("二班长", 2000);
        MilitaryPerson BZ13 = new MilitaryOfficer("三班长", 2000);
        MilitaryPerson BZ21 = new MilitaryOfficer("一班长", 2000);
        MilitaryPerson BZ22 = new MilitaryOfficer("二班长", 2000);
        MilitaryPerson BZ23 = new MilitaryOfficer("三班长", 2000);
        MilitaryPerson[] SB = new MilitarySoldier[60];
        for (int i = 0; i < SB.length; i++) {
            SB[i] = new MilitarySoldier("小兵", 1000);
        }
        LZ.add(PZ1);
        LZ.add(PZ2);
        PZ1.add(BZ11);
        PZ1.add(BZ12);
        PZ1.add(BZ13);
        PZ2.add(BZ21);
        PZ2.add(BZ22);
        PZ2.add(BZ23);
        for (int i = 0; i <= 9; i++) {
            BZ11.add(SB[i]);
            BZ12.add(SB[i + 10]);
            BZ13.add(SB[i + 20]);
            BZ21.add(SB[i + 30]);
            BZ22.add(SB[i + 40]);
            BZ23.add(SB[i + 50]);
        }
        System.out.println("一排的军饷:" + ComputerSalary.computerSalary(PZ1));
        System.out.println("一班的军饷:" + ComputerSalary.computerSalary(BZ11));
        System.out.println("全连的军饷:" + ComputerSalary.computerSalary(LZ));
    }
}
